using Microsoft.Practices.Composite.UnityExtensions;
using PrismNavigationFramework.Navigation.Controls;
using PrismNavigationFramework.RegionAdapters;
using Microsoft.Practices.Unity;

namespace PrismNavigationFramework.Navigation
{
    public abstract class PrismNavigationFrameworkUnityBootstrapper : UnityBootstrapper
    {
        protected override void ConfigureContainer()
        {
            base.ConfigureContainer();

            Bootstrapper.Initialize(Container);
        }

        protected override Microsoft.Practices.Composite.Presentation.Regions.RegionAdapterMappings ConfigureRegionAdapterMappings()
        {
            var adapters = base.ConfigureRegionAdapterMappings();
            adapters.RegisterMapping(typeof(PrismNavigationMainFrame), Container.Resolve<PrismMainFrameRegionAdapter>());
            adapters.RegisterMapping(typeof(PrismNavigationSecondaryFrame), Container.Resolve<PrismSecondaryFrameRegionAdapter>());
            return adapters;
        }
    }
}